package com.ham.mud.commands;

import com.ham.mud.Colors;
import com.ham.mud.Runner;
import com.ham.mud.ServerConnection;

import java.util.List;

/**
 * Created by hlucas on Jun 30, 2011 at 2:48:54 PM
 */
public class GodVoiceCommand extends PlayerCommand {
    @Override
    public void execute(ServerConnection connection, String[] params) {
        if(!connection.getPlayer().getName().equals("Ham")) {
            connection.printSolo("Nice try.");
            return;
        }
        
        StringBuilder sb = new StringBuilder();
        for(String param : params) {
            sb.append(param);
            sb.append(" ");
        }
        List<ServerConnection> serverConnectionList = Runner.STATIC_INSTANCE.getConnections();
        for(ServerConnection serverConnection : serverConnectionList) {
            serverConnection.printSolo(Colors.NEW_LINE + "{wA booming voice from the {Wh{Ye{Wa{Cv{We{Yn{Ws{w proclaims, {W\"{C" + sb.toString().trim() + "{W\"{w");
        }
    }

    @Override
    protected String getCommandName() {
        return "godvoice";
    }
}
